<template>
	<div class="page-system-organ">

		<div>
			<div>
				<ul>
                    <li><label for="">药店编号</label><span>{{organ.organCode}}</span></li>
                    <li><label for="">药店名称</label><span>{{organ.organName}}</span></li>
                    <li>
                        <label for="">简介</label>
                        <span v-if="!update">{{organ.description}}</span>
                        <Input v-else v-model="organ.description" placeholder="" style="width: 600px" />
                    </li>
                    <li>
                        <label for="">所在地址</label>
                        <span v-if="!update">{{organ.address}}</span>
                        <Input v-else type="textarea" placeholder="" style="width: 600px" />
                    </li>
                    <li>
                        <label for="">联系人</label>
                        <span v-if="!update">~~</span>
                        <Input v-else  placeholder="" style="width: 600px" />
                    </li>
                    <li>
                        <label for="">联系电话</label>
                        <span v-if="!update">{{organ.mobile}}</span>
                        <Input v-else v-model="organ.mobile" placeholder="" style="width: 600px" />
                    </li>
                    <li>
                        <label for="">电子邮箱</label>
                        <span v-if="!update">{{organ.email}}</span>
                        <Input v-else v-model="organ.email"  placeholder="" style="width: 600px" />
                    </li>
                    <li>
                        <label for="">预约电话</label>
                        <span v-if="!update">{{organ.appointmentPhone}}</span>
                        <Input v-else v-model="organ.appointmentPhone"  placeholder="" style="width: 600px" />
                    </li>
                </ul>
			</div>
		</div>
	</div>
</template>
<script>
import { organPageQueryList, organAdd, organGet, organUpdate } from '@api/organ.js'
import { mapState } from '@lib/x_.js'
export default {
	data() {
		return {
            update: false,
            organ: {
                parentId: 0,
                organLevel: 2,
                organCode: "10001",
                organName: "科信康药店",
                organType: 2,
                contactPerson: "13612345677",
                mobile: "13612345678",
                email: "test@123.com",
                appointmentPhone: "13612345678",
                province: "广东省",
                city: "深圳市",
                district: "南山区",
                address: "广东省深圳市南山区",
            },
		}
	},
	mounted() {
		
	},
	computed: {
        ...mapState(['user'])
	},
	methods: {
        
	},
	watch: {
		user(after){
            const { organId } = after;
            console.log("organGet>")
            organGet({id: organId}).then(res => {
                if (res.code === "0") {
                    this.organ = {...this.organ,...res.data};
                }
            })
        }
	}
}
</script>
<style scoped>
    .page-system-organ{
        background-color: #fff;
    }
    ul{

    }
    ul ,li {
        list-style: none;
    }
    li{
        
        border-bottom: 1px solid #ddd;
        display: flex;
        padding-left: 20px;
        padding-right: 20px;
        align-items: center;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    li label{
        min-width: 80px;
    }
    li span{
        flex: 1;
    }
</style>